package com.example.chess.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.example.chess.ChessApplication;

/**
 * Created by xuyougen.
 */
public class SettingSp {

    private static SharedPreferences preferences;

    static {
        preferences = ChessApplication.getContext().getSharedPreferences("setting", Context.MODE_PRIVATE);
    }

    public static void setRobotMode(boolean robotMode) {
        preferences.edit()
                .putBoolean("robotMode", robotMode)
                .apply();
    }

    public static boolean isRobotMode() {
        return preferences.getBoolean("robotMode", true);
    }

}
